		<?php $routeName = sfContext::getInstance()->getRouting()->getCurrentRouteName() ?>
		<div id="sidebar" >
			<?php include_component('costabrava', 'nordSudVillages', array('nomVillage'=>$village->getNomVillage())) ?>			
			<?php if($routeName=='village_show'):?>
				<?php include_component('costabrava', 'villageViviendas', array('nomVillage'=>$village->getNomVillage())) ?>
			<?php endif ?>
			<?php include_partial('global/suggestionsSidebar') ?>
			<?php if ($sf_user->numberFavorites()>0): ?>
			<?php echo link_to('Mes favoris ('.$sf_user->numberFavorites().')', '@list_favorites', array('id'=>'favoritesNumber')) ?>
			<?php endif ?>
		</div>	
		<div id="breadcrumbs"><?php echo link_to('Accueil', '@homepage') ?> > <?php echo link_to('Guide Costa Brava', '@costa_brava') ?> > <?php echo link_to('Villages', '@list_costa_brava_villages') ?> > <?php echo $village->getNomVillage() ?></div>
		<div id="main">		
		<h1><?php echo $village->getNomVillage() ?></h1>
			<div class="post">
						<blockquote><p><?php echo $village->getDescPreVillage() ?></p></blockquote>
		<?php if (isset($current[0])): ?>				
			<div class="weatherBlock" style="">			
			<div class="weather" style="float:left;margin-top:22px;">		
				<img alt="<?php echo $information[0]->city['data']; ?> <?php echo $current[0]->condition['data'] ?>" title="<?php echo $information[0]->city['data']; ?> <?php echo $current[0]->condition['data'] ?>" src="<?php echo ('http://www.google.com'.$current[0]->icon['data'])?>" ?>
			
			
			</div>
			<div style="float:left;font-size:12px;margin-top:18px;margin-right: 40px;margin-left: 10px;">
					<div><?php echo $current[0]->temp_c['data'] ?>&deg; C</div><div><?php echo $current[0]->humidity['data'] ?></div><div><?php echo $current[0]->condition['data'] ?></div>
			</div>
			<?php foreach ($forecast_list as $forecast) : ?>
			<div class="weather" style="float:left; margin-right: 20px;">
				<div style="text-align:center;"><?php echo $forecast->day_of_week['data']; ?></div>
				<img alt="<?php echo $forecast->condition['data'] ?>" title="<?php echo $forecast->condition['data'] ?>" src="<?php echo('http://www.google.com' .$forecast->icon['data'])?>" alt="weather"?>
				
				<div class="condition" style="font-size:10px;text-align: center;">
					<?php echo $forecast->low['data'] ?>&deg;C | <?php echo $forecast->high['data'] ?>&deg;C
				</div>
			</div>	
			<?php endforeach ?>
			</div>
		<?php endif ?>

		<div style="clear:both;" id="descVillage"><?php echo htmlspecialchars_decode($village->getDescVillage()) ?></div>
			<p><div id="mapVillage"></div></p>
			</div>
			
			<div id="panoramioResults">
	<?php if(isset($json_panoramio)): for ($i=0; $i<count($json_panoramio->photos); $i++) : $foto_actual = $json_panoramio->photos[$i] ?>
	<div class="panoramioFrame">
		<div class="panoramioPhoto">
			<a target="_blank" rel="nofollow" href="<?php echo $foto_actual->photo_url ?>"><img class="panoramioImage" src="<?php echo $foto_actual->photo_file_url ?>" width="<?php echo $foto_actual->width ?>" height="<?php echo $foto_actual->height ?>" /></a>
		</div>
	<div>
	<img alt="Panoramio" src="/images/panoramio.gif" />
		<p style="margin: 0px; padding: 3px 0px;"><i><?php echo $foto_actual->photo_title ?></i></p>
	</div>
</div>		
	<?php endfor ?>
	<?php endif ?>
</div>

		<div id="villagesDistList">	
			<h2>Villages pres de <?php echo $village->getNomVillage() ?></h2>
			<ul class="villagesPresList">
			<?php foreach($nearest_list as $v): ?>
				<li class="villagesPres">
				<?php echo link_to(image_tag(sfConfig::get('app_thumb_village_path').$v->getSlug().'/'.$v->getSlug().'.jpg', 'alt='.$v->getNomVillage().' size=100x75'), 'village_show', $v) ?>	
				<div class="villagesPresDist"> &Agrave; <?php echo round($v['distance'], 1)?> km</div>
				<div class="villagesPresNom"><?php echo link_to($v->getNomVillage(), 'village_show', $v, array('title' => $v->getDescPreVillage()))  ?></div>
				<div class="villagesPresFleche">>></div>
				<div class="villagePresDesc"><?php echo $v->getDescPreVillage() ?> </div>
				</li>
			<?php endforeach ?>
			</ul>
		</div>
	</div>
<script src="http://maps.google.com/maps?file=api&v=1&key=<?php echo sfConfig::get('app_googlemaps_key') ?>" type="text/javascript"></script> 


<script type="text/javascript">
$(document).ready(function(){
       /*
		$('p:has(img)').each(function(){
			alert("Thanks for visiting!");
		});
		
		$('p:has(img)').replaceWith('<h2>New heading</h2>');
		*/
		jQuery.fn.captions = function(value){

	$(this).wrap("<div class='picPhoto' style='width:"+this.width+"px;'><div></div></div>");
	$(this).after('<div><p class="picText"><i>'+this.alt+'</i></p></div>');
	

};
		$("p>img").each(jQuery.fn.captions);
		$("p").css('clear', 'both');
	});
		</script> 
<script type="text/javascript">
 
			var map = new GMap(document.getElementById("mapVillage"));  
			map.removeMapType(G_HYBRID_MAP);				
			map.addControl(new GOverviewMapControl())					
			map.addControl(new GLargeMapControl3D()); 
			map.addControl(new GMapTypeControl()); 
			map.setCenter(new GLatLng(<?php echo $village->getGeolatitud() ?>,<?php echo $village->getGeolongitud() ?>), 12, G_PHYSICAL_MAP);
			map.addMapType(G_PHYSICAL_MAP);
			
			var point = new GLatLng(<?php echo $village->getGeolatitud() ?>,<?php echo $village->getGeolongitud() ?>);
			var marker = new GMarker(point);
			var gmText = '<div style="float:left;margin-right:3px;"><h4><?php echo $village->getNomVillage() ?></h4><div></div><div>Sup. <?php echo $village->getSuperficie() ?> km<sup>2</sup></div><div>Population: <?php echo $village->getPopulation() ?> hab</div></div><img height="55" width="75" src="<?php echo sfConfig::get('app_thumb_village_path').$village->getSlug() ?>/<?php echo $village->getSlug() ?>.jpg" style="style="float: right; border:1px solid;/>';
			GEvent.addListener(marker, "click", function() { 
				marker.openInfoWindowHtml(gmText);
			});
            map.addOverlay(marker);	
			marker.openInfoWindowHtml(gmText);
			

		</script>